package com.zcz.umengpush.service;

import com.zcz.umengpush.mapper.PushUserMapper;
import com.zcz.umengpush.pojo.PushUser;
import com.zcz.umengpush.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 王卫帅
 */
@Service
public class PushUserService {
    @Autowired
    private PushUserMapper pushUserMapper;
    /**
     * 查询全部
     * @return
     */
    public List<PushUser> selectAll (){
        List<PushUser> pushUsers = pushUserMapper.selectAll();
        System.err.println(pushUsers);
        return pushUsers;
    }

    /**
     * 分页查询
     * @param everyPage  每页显示的条数
     * @param currentPage 当前页
     * @return
     */
    public PageResult<PushUser> selectList (int everyPage, int currentPage){
//        List<PushUser> pushUsers = pushUserMapper.selectList(everyPage,currentPage);
//        Example example = new Example(PushUser.class);
//        Example.Criteria criteria = example.createCriteria();
//        criteria.andEqualTo("userType","0");
//        long i = pushUserMapper.selectCountByExample(example);
//        //System.err.println(i);
//        PageInfo<PushUser> pageInfo = new PageInfo<>(pushUsers);
//
//        PageResult<PushUser> pushUserPageResult = new PageResult<>(i, pageInfo.getList());

        return null;
    }
}
